﻿@model EventPlanner.Models.Evento

@{
    ViewBag.Title = "Detalles";
}
 <div class="subtitle">
<h2>Detalles</h2>
</div>
<fieldset>
    <legend>@EventPlanner.Resources.Global.Global.lbl_Evento</legend>

    <div class="display-label">@EventPlanner.Resources.Global.Global.lbl_Nombre</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Nombre)
    </div>

    <div class="display-label">@EventPlanner.Resources.Global.Global.lbl_Descripcion</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Descripcion)
    </div>

    <div class="display-label">@EventPlanner.Resources.Global.Global.lbl_Fecha</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Fecha)
    </div>

    <div class="display-label">@EventPlanner.Resources.Global.Global.lbl_Hora</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Hora)
    </div>

    <div class="display-label">@EventPlanner.Resources.Global.Global.lbl_Lugar</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Lugar)
    </div>
  
    <div class="display-label">@EventPlanner.Resources.Global.Global.lbl_Cupo</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Cupo)
    </div>
    <div class="display-label">
        Participantes (@Html.DisplayFor(model => model.Participantes.Count)) - 
        @Html.ActionLink("Registrar", "../Participante/Create", new { id= Model.id })
    </div>
   
   @if (Model.Participantes.Count !=0)
   {
    <table>
            <tr>
                <th>
                    @EventPlanner.Resources.Global.Global.lbl_Nombre
                </th>
                <th>
                    @EventPlanner.Resources.Global.Global.lbl_Correo
                </th>
                <th>
                    @EventPlanner.Resources.Global.Global.lbl_Confirmado
                </th>
                
            </tr>
            @foreach (EventPlanner.Models.Participante p in Model.Participantes)
            {
                <tr>
                    <td>
                        @p.Nombre
                    </td>
                    <td>
                        @p.Correo
                    </td>
                    <td>
                        @(p.Confirmado ? "Sí" : "No")
                    </td>
                    <td>
                    @if (!p.Confirmado)
                    {
                        @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Confirmar, "Confirmar", new { controller = "Participante", id = p.id })
                    }
                    else
                    {
                        @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Cancelar, "Cancelar", new { controller = "Participante", id = p.id })
                    }           
                    | @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Eliminar, "Delete", new { controller = "Participante", id = p.id })
                    </td>                    
                </tr>
            }
    </table>
   }
</fieldset>
<p>
    @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Editar, "Edit", new { id = Model.id }) |
    @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_VolverLista, "Index")
</p>
